﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace FinalProject
{
    public class CongViecUngVien
    {
        #region Attributes
        private string _ID;

        public string ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private string _CongViecID;

        public string CongViecID
        {
            get { return _CongViecID; }
            set { _CongViecID = value; }
        }

        private string _EmpID;

        public string EmpID
        {
            get { return _EmpID; }
            set { _EmpID = value; }
        }
        private bool _IsNopHoSo;

        public bool IsNopHoSo
        {
            get { return _IsNopHoSo; }
            set { _IsNopHoSo = value; }
        }
        private DateTime _Ngay;

        public DateTime Ngay
        {
            get { return _Ngay; }
            set { _Ngay = value; }
        }

        private string _Ten;

        public string Ten
        {
            get { return _Ten; }
            set { _Ten = value; }
        }
        private string _NoiLamViec;

        public string NoiLamViec
        {
            get { return _NoiLamViec; }
            set { _NoiLamViec = value; }
        }
        private string _TinhTrang;

        public string TinhTrang
        {
            get { return _TinhTrang; }
            set { _TinhTrang = value; }
        }

        private string _NoiLamViecID;

        public string NoiLamViecID
        {
            get { return _NoiLamViecID; }
            set { _NoiLamViecID = value; }
        }
        #endregion 

        public CongViecUngVien()
        {            
        }

        public CongViecUngVien(CongViecUngVien data)
        {
            _CongViecID = data._CongViecID;
            _EmpID = data._EmpID;
            _ID = data._ID;
            _IsNopHoSo = data._IsNopHoSo;
            _Ngay = data._Ngay;
        }

        public CongViecUngVien(string id, string congViecID, string empID, bool isNopHoSo, DateTime ngay, string noiLamViecID)
        {
            _Ngay = ngay;
            _IsNopHoSo = isNopHoSo;
            _ID = id;
            _EmpID = empID;
            _CongViecID = congViecID;
            _NoiLamViecID = noiLamViecID;

            _Ten = Utility.getCongViecByID(_CongViecID).Ten;
            _NoiLamViec = Utility.GetTenRootObject(Utility.LstTinhThanh, _NoiLamViecID);
            _TinhTrang = _IsNopHoSo == true ? "Đã ứng cử" : "Đã lưu";
        }
    }
}
